﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace AIS.SDK.Model
{
    public class FSREvent
    {
        //Allowed Values: [ "SetQBEValue", "SetControlValue", "SetRadioButton", "SetComboValue", "DoAction", "SetCheckboxValue", "SelectRow", "UnSelectRow", "UnSelectAllRows", "SelectAllRows", "ClickGridCell", "ClickGridColumnAggregate", "NextGrid" ]
        public string command { get; set; }

        public string controlID { get; set; }
        [JsonIgnore]
        public string fieldname { get; set; }
        public string value { get; set; }

        public GridAction gridAction { get; set; }


    }



    public class FormActionsCollection : List<FSREvent>
    {
        public FormActionsCollection()
            : base()
        {
        }

        public FormActionsCollection(IEnumerable<FSREvent> collection)
            : base(collection)
        {
        }

        public FormActionsCollection FromJson(string jsonstr)
        {
            FormActionsCollection conditions = new FormActionsCollection();
            conditions.AddRange(JsonConvert.DeserializeObject<List<FSREvent>>(jsonstr));
            return conditions;
        }
    }
}
